function data = loadTrainingData(index, filename, spindleInterval, notSpindleInterval, samplingRate)

% Loads training data in a persistent structure array.

persistent trainingData

trainingData(index).filename = filename;
trainingData(index).spindleInterval = spindleInterval;
trainingData(index).notSpindleInterval = notSpindleInterval;
trainingData(index).samplingRate = samplingRate;

data = trainingData;